<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
</head>
<body>
    <ul>
        <li>html <button>删除</button></li>
        <li>css <button>删除</button></li>
        <li>javascript<button>删除</button></li>
    </ul>
    <script>
        var btns = document.getElementsByTagName("button");
        for(var i = 0;i<btns.length;i++){
            btns[i].onclick = function(){
                var res = confirm("是否删除")
                if(res==true){
                    this.parentNode.style.display = "none"
                }
            }
        }
    </script>
</body>
</html>